package edu.uta.cse6339.facetedinterface.read.article.labels;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class StateLabeledArticles {

	private static HashMap<String,Set<String>> classifedArticles = new HashMap<String,Set<String>>();
	
	//private static final String STATE_LABLED_FILE_NAME="src/edu/uta/cse6339/facetedinterface/resources/classified/rowOutFile.txt";
	private static final String STATE_LABLED_FILE_NAME="data/output/rowOutFile.txt";
	public static void initialise(){
		classifedArticles= ReadClassfiedArticleLabels.readArticleLabels(STATE_LABLED_FILE_NAME);
	}
	
	public static Set<String> getArticlesByStates(Set<String> states){
		Set<String> statesArticles = new HashSet<String>();
		for(String state: states){
			Set<String> stateArticles=classifedArticles.get(state);
			if(stateArticles!=null && stateArticles.size()>0){
		//		System.out.println(state+" articles "+stateArticles);
				statesArticles.addAll(stateArticles);
			}
		}
		return statesArticles;
	}
	

}
